<div class="modal-header" style="padding:3px 10px;">
    <b style="font-size:16px;">编辑岗位信息</b>
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>	
</div>
<div class="modal-body clearfix">
    <form id="ad_Form" class="form-horizontal m-t" method="Post">
        <input type="hidden" name="position_id" value="{$position_id}">
        <div class="col-sm-12">
            <div class="form-group">
                <label class="control-label col-sm-2" for="name">岗位名称：</label>  
                <div class="col-sm-8">
                    <input type="text" name="name"  value="{$name}" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2 col-sm-offset-1" for="name">所属部门：</label>  
                <div class="col-sm-8">
                    <input type="text" readonly="readonly" value="{$department_name}" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2 col-sm-offset-1" for="name">上级岗位：</label>  
                <div class="col-sm-4">
                    <select id="depart" class="form-control">
                        <option value="a">--选择部门--</option>
                        <volist name="department_list" id="vo" key="k">
                            <option value="{$vo['department_id']}">{$vo['name']}</option>
                        </volist>
                    </select>
                </div>
                <div class="col-sm-4">
                    <select id="posi" name="parent_id" class="form-control">
                        <option value="">--选择上级岗位--</option>
                        <volist name="position_list" id="vo" key="k">
                            <option deId="{$vo['department_id']}" value="{$vo['position_id']}">{$vo['name']}</option>
                        </volist>
                    </select>
                </div>
                <div class="col-sm-4">
                </div>
            </div>
            <div class="form-group ">
                <label class="control-label col-sm-2" for="name">岗位描述：</label>  
                <div class="col-sm-8">
                    <textarea name="description" id="" class="form-control" cols="30" rows="3">{$description}</textarea>
                </div>
            </div>
        </div>
    </form>
</div>
<script>
    $(document).ready(function () {
        $('.date').datepicker({
            format: "yyyy-mm-dd",
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });
        $("#adbtn").click(function () {
            $.ajax({
                type: "POST",
                url: "{:U('position_edit')}",
                data: $("#ad_Form").serialize(),
                async: true,
                success: function (data) {
                    if (data.status == 1) {
                        swal({
                            title: "修改成功！",
                            text: "跳转中!",
                            type: "success"
                        });
                        $('#Modal').modal('hide');
                        top.location.reload();
                    } else {
                        swal({
                            title: "修改失败!",
                            text: data.info,
                            type: "error"
                        });
                    }
                }
            });
        })
    });
</script>
<div class="modal-footer">
    <button type="button" id="adbtn" class="btn btn-primary">保存</button>
    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
</div>

